<?php 
session_start();
include "../dbcon.php";$a = mysql_fetch_array(mysql_query("select * from khachhang where id='".$_SESSION['myname']."'"));
?>
<html>
<head>
	<script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript" src="../js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="../localization/messages_vi.js"></script>
<script type="text/javascript">
		$(document).ready(function(){
			$("#doithongtin").validate({
				errorElement: "span", //Thành phần HTML hiện thông báo lỗi
				//Sử dụng tùy chọn rules cho những validate không hỗ trợ bởi class name
				rules: {
					cpassword: {
						equalTo: "#password" //So sánh với trường cpassword với thành trường có id là password
					},
					min_field: { min: 5 }, //Giá trị tối thiểu
					max_field: { max : 10 }, //Giá trị tối đa
					range_field: { range: [4,10] }, //Giá trị trong khoảng từ 4 - 10
					rangelength_field: { rangelength: [4,10] } //Chiều dài chuỗi trong khoảng từ 4 - 10 ký tự
				}
			});
		});
	</script>
<script>
	function gt()
		{
			if(document.getElementById("gt_nu").checked)
			{
				document.getElementById("gt_nam").checked=false
				document.getElementById("hiddengt").value=1
			}
			else 
			{
				document.getElementById("gt_nam").checked=true
				document.getElementById("hiddengt").value = 0
			}
		}
	
	function gt2()
	{
			if(document.getElementById("gt_nam").checked)
			{
				document.getElementById("hiddengt").value = 0
				document.getElementById("gt_nu").checked=false
			}
			else 
			{
				document.getElementById("gt_nu").checked=true
				document.getElementById("hiddengt").value=1
			}
	}
</script>
<link href="../CSS/dk.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="doithongtin_css" class="bgdk">
<form id="doithongtin" action="../libs/xulydoithongtin.php" method="post">
<table>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Mật khẩu :</td>
		<td style="float:left"><input class="required" class="Text" type="password" maxlength="20" id="mk" name="mk" tabindex="1"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Họ :</td>
		<td style="float:left"><input value = <?php echo '"'.$a['Ho'].'"';?> name="ho" id="ho" class="required" class="Text" type="text" maxlength="20" tabindex="2"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Tên lót :</td>
		<td style="float:left"><input value=<?php echo '"'.$a['TenLot'].'"';?> name="tenlot" id="tenlot" class="required" class="Text" type="text" maxlength="20" tabindex="3"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Tên :</td>
		<td style="float:left"><input value=<?php echo '"'.$a['Ten'].'"';?> name="ten" id="ten" class="required" class="Text" type="text" maxlength="20" tabindex="4"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Địa chỉ :</td>
		<td style="float:left"><input value=<?php echo '"'.$a['DiaChi'].'"';?> name="diachi" id="diachi" class="required" class="Text" type="text" maxlength="100" tabindex="5"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Số điện thoại :</td>
		<td style="float:left"><input value=<?php echo '"'.$a['SDT'].'"';?> name="sdt" id="sdt" class="required" class="text" type="text" maxlength="11" tabindex="6"></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Giới tính :</td>
		<td style="float:left">Nam <input type="checkbox" tabindex="6" name="gt[]" id="gt_nam" onClick="gt2()" <?php if(!$a['GioiTinh']) echo 'checked="checked"' ?> > 
			Nữ <input type="checkbox" onClick="gt()" tabindex="7" name="gt[]" id="gt_nu" <?php if($a['GioiTinh']) echo 'checked="checked"'?> ><input type="hidden" name="hiddengt" id="hiddengt" value="<?php if($a['GioiTinh']) echo '1'; else echo '0';?>"  ></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;">Email :</td>
		<td style="float:left"><input value=<?php echo '"'.$a['Email'].'"';?> class="required email" id="email" name="email" maxlength="50" type="text" class="text" tabindex="8" /></td>
		<td style="padding-left:10px; color:red;"><span class="rq"> * </span></td>
		</tr>
		<tr height="10px"></tr>
		<tr>
		<td width="100px" align="left" style="padding-left:20px;"></td>
		<td style="float:left; padding-left:30px;"><input type="submit" id="bt_doicauhoi" value="Thực hiện" /></td>
		</tr>
</table>
</form>
</div>
</body>
</html>